package cn.smdq.ch.upms.admin.pay.channel.param;

import lombok.Data;

/**
 * @author shuimodanqing
 * create at:  2019/1/29  1:57 PM
 * @description 支付宝支付参数
 */
@Data
public class AliPayRequestParam {

    private String appId;

    private String aliPublicKey;

    private String gateWay;

    private String privateKey;

    private String signType;

    private String format;

    private String charset;

    private String notifyUrl;

    private String body;

    private String subject;

    private String outTradeNo;

    private String productCode;

    private String goodsType;

    private String timeoutExpress;

    private String timeExpire;

    private String totalFee;

    public static class Builder {
        private AliPayRequestParam payRequestParam;

        public Builder() {
            this.payRequestParam = new AliPayRequestParam();
        }

        public Builder appId(String appId) {
            this.payRequestParam.appId = appId;
            return this;
        }

        public Builder aliPublicKey(String aliPublicKey) {
            this.payRequestParam.aliPublicKey = aliPublicKey;
            return this;
        }

        public Builder privateKey(String privateKey) {
            this.payRequestParam.privateKey = privateKey;
            return this;
        }

        public Builder signType(String signType) {
            this.payRequestParam.signType = signType;
            return this;
        }

        public Builder format(String format) {
            this.payRequestParam.format = (format != null && !"".equals(format) ? format : "json");
            return this;
        }

        public Builder notifyUrl(String notifyUrl) {
            this.payRequestParam.notifyUrl = notifyUrl;
            return this;
        }

        public Builder totalFee(String totalFee) {
            this.payRequestParam.totalFee = totalFee;
            return this;
        }

        public Builder body(String body) {
            this.payRequestParam.body = body;
            return this;
        }

        public Builder subject(String subject) {
            this.payRequestParam.subject = subject;
            return this;
        }

        public Builder outTradeNo(String outTradeNo) {
            this.payRequestParam.outTradeNo = outTradeNo;
            return this;
        }

        public Builder productCode(String productCode) {
            this.payRequestParam.productCode = productCode;
            return this;
        }

        public Builder goodsType(String goodsType) {
            this.payRequestParam.goodsType = goodsType;
            return this;
        }

        public Builder timeoutExpress(String timeoutExpress) {
            this.payRequestParam.timeoutExpress = timeoutExpress;
            return this;
        }

        public Builder timeExpire(String timeExpire) {
            this.payRequestParam.timeExpire = timeExpire;
            return this;
        }

        public Builder gateWay(String gateWay) {
            this.payRequestParam.gateWay = gateWay;
            return this;
        }

        public Builder charset(String charset) {
            this.payRequestParam.charset = (charset != null && !"".equals(charset) ? charset : "utf-8");
            return this;
        }

        public AliPayRequestParam build() {
            return this.payRequestParam;
        }
    }
}
